{varType ApiGen\Index\Index $index}
{varType ApiGen\Renderer\Latte\Template\ConfigParameters $config}
{varType ApiGen\Renderer\Latte\Template\LayoutParameters $layout}

{define expr, ApiGen\Info\ExprInfo $expr, ?ApiGen\Info\ClassLikeInfo $scope, string $indent = ''}
	{pre}
		{if $expr instanceof ApiGen\Info\Expr\BooleanExprInfo || $expr instanceof ApiGen\Info\Expr\NullExprInfo}
			<span class="php-kw">{$expr->toString()}</span>
		{elseif $expr instanceof ApiGen\Info\Expr\IntegerExprInfo || $expr instanceof ApiGen\Info\Expr\FloatExprInfo}
			<span class="php-num">{$expr->raw}</span>
		{elseif $expr instanceof ApiGen\Info\Expr\StringExprInfo}
			<span class="php-str">{$expr->raw ?? $expr->toString()}</span>
		{elseif $expr instanceof ApiGen\Info\Expr\ArrayExprInfo}
			{embed autoBreakingLine, items: $expr->items, maxWidth: 100, indent: $indent}
				{block before}{="["}{/block}
				{block after}{="]"}{/block}
				{block item}
					{if $item->key}{include expr, expr: $item->key, scope: $scope} =&gt; {/if}
					{include expr, expr: $item->value, scope: $scope, indent: "\t$indent"}
				{/block}
				{block sep},{/block}
			{/embed}
		{elseif $expr instanceof ApiGen\Info\Expr\ClassConstantFetchExprInfo}
			{if $expr->classLike->fullLower === 'self' && $scope}
				{var $memberClassLike = $scope}
				{include classLikeLink, classLike: $memberClassLike, text: $expr->classLike->fullLower}
			{elseif $expr->classLike->fullLower === 'parent' && $scope && isClass($scope) && $scope->extends}
				{var $memberClassLike = $index->classLike[$scope->extends->fullLower]}
				{include classLikeLink, classLike: $memberClassLike, text: $expr->classLike->fullLower}
			{elseif isset($index->classLike[$expr->classLike->fullLower])}
				{var $memberClassLike = $index->classLike[$expr->classLike->fullLower]}
				{include classLikeLink, classLike: $memberClassLike, short: true}
			{else}
				{var $memberClassLike = null}
				{$expr->classLike->full}
			{/if}
			::
			{if $memberClassLike !== null && isset($memberClassLike->constants[$expr->name])}
				{var $member = $memberClassLike->constants[$expr->name]}
				{embed memberLink, $memberClassLike, $member}{block content}{$member->name}{/block}{/embed}
			{elseif $memberClassLike !== null && isEnum($memberClassLike) && isset($memberClassLike->cases[$expr->name])}
				{var $member = $memberClassLike->cases[$expr->name]}
				{embed memberLink, $memberClassLike, $member}{block content}{$member->name}{/block}{/embed}
			{else}
				{$expr->name}
			{/if}
		{elseif $expr instanceof ApiGen\Info\Expr\ConstantFetchExprInfo}
			{$expr->name}
		{elseif $expr instanceof ApiGen\Info\Expr\UnaryOpExprInfo}
			{$expr->op}
			{include this, expr: $expr->expr, scope: $scope}
		{elseif $expr instanceof ApiGen\Info\Expr\BinaryOpExprInfo}
			{include this, expr: $expr->left, scope: $scope}
			{=" "}{$expr->op}{=" "}
			{include this, expr: $expr->right, scope: $scope}
		{elseif $expr instanceof ApiGen\Info\Expr\TernaryExprInfo}
			{include this, expr: $expr->condition, scope: $scope}
			{if $expr->if} ? {include this, expr: $expr->if, scope: $scope} : {else} ?: {/if}
			{include this, expr: $expr->else, scope: $scope}
		{elseif $expr instanceof ApiGen\Info\Expr\DimFetchExprInfo}
			{include this, expr: $expr->expr, scope: $scope}
			[{include this, expr: $expr->dim, scope: $scope}]
		{elseif $expr instanceof ApiGen\Info\Expr\PropertyFetchExprInfo}
			{include this, expr: $expr->expr, scope: $scope}
			-&gt;
			{if is_string($expr->property)}
				{$expr->property}
			{else}
				{{include this, expr: $expr->property, scope: $scope}}
			{/if}
		{elseif $expr instanceof ApiGen\Info\Expr\NullSafePropertyFetchExprInfo}
			{include this, expr: $expr->expr, scope: $scope}
			?-&gt;
			{if is_string($expr->property)}
				{$expr->property}
			{else}
				{{include this, expr: $expr->property, scope: $scope}}
			{/if}
		{elseif $expr instanceof ApiGen\Info\Expr\NewExprInfo}
			{var $classLike = $index->classLike[$expr->classLike->fullLower]}
			<span class="php-kw">new</span> {include classLikeLink, classLike: $classLike, short: true}
			(
			{foreach $expr->args as $arg}
				{if $arg->name}{$arg->name}: {/if}
				{include this, expr: $arg->value, scope: $scope}
				{sep}, {/sep}
			{/foreach}
			)
		{else}
			ERROR
		{/if}
	{/pre}
{/define}
